//
//  NSString+Time.m
//  WallPager
//
//  Created by mt on 17/1/14.
//  Copyright © 2017年 吴超飞. All rights reserved.
//

#import "NSString+Time.h"

@implementation NSString (Time)

- (NSString *)interceptTimeStampFromStr:(NSString *)str{
    
    NSTimeInterval time=[str doubleValue];
    NSDate *detaildate=[NSDate dateWithTimeIntervalSince1970:time];
    //实例化一个NSDateFormatter对象
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    //设定时间格式,这里可以设置成自己需要的格式
    [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
    NSString* reStr = [dateFormatter stringFromDate:detaildate];
    
    return reStr;
}

@end
